<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户注册</title>

    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f7f9fc;
            margin: 0;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100vh;
        }

        .register-container {
            background-color: #ffffff;
            padding: 30px 40px;
            border-radius: 12px;
            box-shadow: 0 8px 16px rgba(0,0,0,0.1);
            width: 100%;
            max-width: 400px;
        }

        .register-container h2 {
            text-align: center;
            margin-bottom: 25px;
            color: #333;
        }

        .register-container label {
            display: block;
            margin-bottom: 8px;
            font-weight: bold;
        }

        .register-container input[type="text"],
        .register-container input[type="email"],
        .register-container input[type="password"] {
            width: 100%;
            padding: 12px;
            margin-bottom: 20px;
            border: 1px solid #ccc;
            border-radius: 6px;
            box-sizing: border-box;
        }

        .register-container button {
            width: 100%;
            background-color: #4CAF50;
            color: white;
            padding: 12px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 1rem;
        }

        .register-container button:hover {
            background-color: #45a049;
        }

        .register-container .back-link {
            text-align: center;
            margin-top: 20px;
        }

        .register-container .back-link a {
            color: #4CAF50;
            text-decoration: none;
        }

        .register-container .back-link a:hover {
            text-decoration: underline;
        }
    </style>
</head>

<body>

<div class="register-container">
    <h2>用户注册</h2>
    <form th:action="@{/login}" method="post" th:object="${user}">
        <input type="text" th:field="*{username}" class="input-field" placeholder="用户名" required /><br />
        <input type="password" th:field="*{password}" class="input-field" placeholder="密码" required /><br />
        <button type="submit" class="login-button">登录</button>
    </form>

    <div class="back-link">
        已有账号？<a href="login.html">去登录</a>
    </div>
</div>

</body>
</html>
